﻿using LardonPokerSimulator.Model.Deck;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LardonPokerSimulatorTest.Model.Deck
{
    [TestClass]
    public class TestCards
    {
        [TestMethod]
        public void TestGenerateFrenchDeck()
        {
            Cards cards = new Cards();
            cards.GenerateFrenchDeck();

            Card firstCard = cards.cardArray[0];
            Assert.AreEqual(1, firstCard.Number);
            Assert.AreEqual("Clubs", firstCard.Suit);

            Card lastCard = cards.cardArray[cards.cardArray.Length - 1];
            Assert.AreEqual(13, lastCard.Number);
            Assert.AreEqual("Spades", lastCard.Suit);

            Assert.AreEqual(52, cards.cardArray.Length);
        }

        [TestMethod]
        public void TestPickRandomCard()
        {
            Card c = null;
            Cards cards = new Cards(10);
            cards.GenerateFrenchDeck();

            c = cards.PickRandomCard();
            Assert.AreEqual(11, c.Number);
            Assert.AreEqual(Suit.Spades, c.suit);

            c = cards.PickRandomCard();
            Assert.AreEqual(13, c.Number);
            Assert.AreEqual(Suit.Hearts, c.suit);
        }
    }
}
